home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Productivity Pak 3 / rerun-productivity-pak-iii-side-a.d64 / menu 64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  99 lines

  1. 1 rem *********************************
  2. 2 rem *         'auto menu'           *
  3. 3 rem * reads directory & auto loads  *
  4. 4 rem * program selected by the user  *
  5. 5 rem *             by                *
  6. 6 rem * joe w. rocke          7/27/84 *
  7. 7 rem *********************************
  8. 10 poke53280,0:poke53281,0
  9. 20 dim n$(100):cx=54272:print "[147]"
  10. 30 print"[147][129]"
  11. 40 x$="                                       "
  12. 50 forx=1to5:printx$:next
  13. 60 print"":print chr$(117);
  14. 70 for x=1 to 38:printchr$(100);:next
  15. 80 printchr$(105);:for x=1 to 5
  16. 90 printchr$(103)spc(38)chr$(104)" "chr$(157);:next
  17. 100 printchr$(106);:for x=1 to 38:printchr$(102);:next:printchr$(107)
  18. 110 print""tab(14)"* auto menu *"
  19. 120 printtab(12)"[158]reading directory"
  20. 129 rem --- read disk directory ---
  21. 130 open1,8,0,"$"
  22. 140 get#1,b$:ifst<>0then260
  23. 149 rem --- line 150 limits to 26 files ---
  24. 150 iff>=27then260
  25. 160 ifb$<>chr$(34)then140
  26. 170 n$="":print"":poke 214,8:print
  27. 180 get#1,b$:ifb$<>chr$(34)thenn$=n$+b$:goto180
  28. 185 get#1,b$:ifb$=chr$(32)then190
  29. 190 ifn$="rs.sm"thenf=f-1:goto240
  30. 191 ifn$="rs.s"thenf=f-1:goto240
  31. 192 ifn$="rs.t"thenf=f-1:goto240
  32. 193 ifn$="rs.u"thenf=f-1:goto240
  33. 194 ifn$="rs.v"thenf=f-1:goto240
  34. 195 ifn$="rs.w"thenf=f-1:goto240
  35. 196 ifn$="rs.x"thenf=f-1:goto240
  36. 197 ifn$="rs.y"thenf=f-1:goto240
  37. 198 ifn$="rs.z"thenf=f-1:goto240
  38. 199 ifn$="rs.pm"thenf=f-1:goto 240
  39. 200 ifn$="rs.a"thenf=f-1:goto240
  40. 201 ifn$="rs.b"thenf=f-1:goto240
  41. 202 ifn$="rs.c"thenf=f-1:goto240
  42. 203 ifn$="rs.cm"thenf=f-1:goto240
  43. 204 ifn$="rs.d"thenf=f-1:goto240
  44. 205 ifn$="rs.e"thenf=f-1:goto240
  45. 206 ifn$="rs.f"thenf=f-1:goto240
  46. 207 ifn$="rs.g"thenf=f-1:goto240
  47. 208 ifn$="rs.h"thenf=f-1:goto240
  48. 209 ifn$="rs.i"thenf=f-1:goto240
  49. 210 ifn$="rs.j"thenf=f-1:goto240
  50. 211 ifn$="rs.k"thenf=f-1:goto240
  51. 212 ifn$="rs.l"thenf=f-1:goto240
  52. 213 ifn$="rs.m"thenf=f-1:goto240
  53. 214 ifn$="rs.n"thenf=f-1:goto240
  54. 215 ifn$="rs.o"thenf=f-1:goto240
  55. 216 ifn$="rs.p"thenf=f-1:goto240
  56. 217 ifn$="rs.q"thenf=f-1:goto240
  57. 218 ifn$="rs.r"thenf=f-1:goto240
  58. 220 ifleft$(n$,1)=" "thenf=f-1:goto240
  59. 230 n$(f)=" "+n$
  60. 240 get#1,b$:ifb$<>""then240
  61. 250 ifst=0thenf=f+1:goto140
  62. 260 close1
  63. 269 rem - print first column of names -
  64. 270 fore=1tof/2:print"[153]"chr$(64+e)""n$(e):next
  65. 280 print"":poke214,8:print
  66. 289 rem -- then 2nd column of names ---
  67. 290 fore=f/2+1tof:printspc(20)"[153]"chr$(64+e)""n$(e):next
  68. 300 print""
  69. 310 printtab(12)"[158] press letter key "
  70. 320 printtab(5)"to auto load program selected"
  71. 330 getm$:ifm$=""then 330
  72. 335 ifm$=chr$(13)thenrun
  73. 340 ifm$=chr$(13)thenrun
  74. 350 ifm$<"a"orm$>chr$(64+f)then330
  75. 351 ifm$="a"orm$="d"then391
  76. 352 ifm$="e"orm$="f"then391
  77. 353 ifm$="h"orm$="i"then391
  78. 354 ifm$="j"then391
  79. 360 p=asc(m$)-64:print"[147]"
  80. 370 iflen(n$(p))>12thenn$(p)=left$(n$(p),12)+"*"
  81. 380 n$(p)=mid$(n$(p),2,len(n$(p)))
  82. 390 print"load"chr$(34)n$(p)chr$(34)",8[145][145][145]":goto460
  83. 391 p=asc(m$)-64:print"[147]"
  84. 392 iflen(n$(p))>15thenn$(p)=left$(n$(p),16)+"*"
  85. 393 n$(p)=mid$(n$(p),2,len(n$(p)))
  86. 394 print"load"chr$(34)n$(p)chr$(34)",8[145][145][145]"
  87. 400 rem *******************************
  88. 410 rem * if you know the pgm is 'ml' *
  89. 420 rem * the example below will load *
  90. 430 rem * and file & run it. examples *
  91. 440 rem * (3) are shown below.        *
  92. 450 rem *******************************
  93. 460 ifleft$(n$(p),4)="tool"thena$="sys64738"+chr$(13):goto500
  94. 470 ifleft$(n$(p),12)="constructio*"thena$="sys49152"+chr$(13):goto500
  95. 480 ifleft$(n$(p),5)="ultra"thena$="sys49152"+chr$(13):goto500
  96. 490 a$="run"+chr$(13)
  97. 500 poke631,13:forb=1tolen(a$):poke631+b,asc(mid$(a$,b,1)):next:poke198,10
  98. 510 new
  99.